import java.util.Scanner;
class Acceleration {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        System.out.print("请输入初速度（米/秒）：");
        if (scanner.hasNextDouble()) {
            double initialVelocity = scanner.nextDouble();
            System.out.print("请输入末速度（米/秒）：");
            if (scanner.hasNextDouble()) {
                double finalVelocity = scanner.nextDouble();
                System.out.print("请输入时间（秒）：");
                if (scanner.hasNextDouble()) {
                    double time = scanner.nextDouble();
                    if (time != 0) {
                        double acceleration = (finalVelocity - initialVelocity) / time;
                        System.out.printf("加速度为 %.2f m/s^2", acceleration);
                    } else {
                        System.out.println("时间不能为零。");
                    }
                } else {
                    System.out.println("输入无效，请输入数字。");
                }
            } else {
                System.out.println("输入无效，请输入数字。");
            }
        } else {
            System.out.println("输入无效，请输入数字。");
        }
        scanner.close();
    }
}
